package automaton;

import java.util.ArrayList;

import automaton.efsm.NondefiniteEFSM;

/**
 * 
 * @author Daniil Chivilikhin
 *
 */
public class FullNfaFactory {
	public static NondefiniteEFSM getFullAutomata(int numberOfStates, int numberOfEvents, ArrayList[] actions) {
		ArrayList<NondefiniteEFSM.Transition>[][] transitions = new ArrayList[numberOfStates][numberOfEvents];
		
		for (int i = 0; i < numberOfStates; i++) {
			for (int j = 0; j < numberOfEvents; j++) {
				transitions[i][j] = new ArrayList<NondefiniteEFSM.Transition>();
				for (int k = 0; k < numberOfStates; k++) {					
					for (int l = 0; l < actions.length; l++) {
						transitions[i][j].add(new NondefiniteEFSM.Transition(i, k, actions[l], j));
					}
				}
			}
		}
		return new NondefiniteEFSM(numberOfStates, numberOfEvents, transitions);
	}
}
